<!--
 * @Descripttion: 入库单
 * @version:
 * @Author: cxguo
 * @Date: 2019-08-02 15:03:05
 * @LastEditors: cxguo
 * @LastEditTime: 2020-08-19 17:01:49
 -->
<template>
  <div class="app-container">
    <div class="clearfix">
      <Tab
        v-model="currentIndex"
        :is-show-date="false"
        :texts="['待入库','已入库']"
        @on-click="onTabClick"
      />
      <component :is="compName" />
    </div>
  </div>
</template>
<script>
import { oftenuse } from '@/libs/mixins'
import Tab from '@/views/components/Tab'
import waite from './waite-list'
import has from './has-list'
export default {
  name: 'StockinList',
  filters: {
  },
  components: { waite, has, Tab },
  mixins: [oftenuse],
  props: {
    /**
     * 1已入库，0待入库
     */
    stockStatus: {
      type: String,
      default: '0'
    }
  },
  data() {
    return {
      currentIndex: 0
    }
  },
  computed: {
    'compName': function() {
      return this.currentIndex === 0 ? 'waite' : 'has'
    }
  },
  watch: {
  },
  created() {
    this.currentIndex = Number(this.stockStatus)
  },
  methods: {
    onTabClick(val) {
      this.currentIndex = Number(val)
    }
  }
}
</script>
